package map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo1 {
    public static void main(String[] args) {
        Map<String, Integer> map = new HashMap<>();
        map.put("a", 1);
        Integer value = map.get("a");
        map.put("b", 2);

        System.out.println(map);
        System.out.println(value);
        System.out.println(map.get("b"));

        map.put("键", 232323);
        System.out.println(map);
        System.out.println(map.size());

        System.out.println(map.remove("键"));
        Integer value1 = map.get("键");
        System.out.println(value1);

        System.out.println(map.isEmpty());

        boolean ck = map.containsKey("键");
        System.out.println("包含key:"+ck);

        boolean cv = map.containsValue(232323);
        System.out.println("包含value:"+cv);

        map.clear();
        System.out.println(map);

    }
}